
import { get, post, del, put, uploadImage } from '../utils/request'
module.exports = {
  createAlbum: function (param) {
    return post('/albums/', param)
  },

  updateAlbum: function (id, param) {
    return put(`/albums/${id}/`, param)
  },

  deleteAlbum: function (id) {
    return del(`/albums/${id}/`)
  },

  getAlbums: function (query) {
    return get('/albums/', {}, query)
  },
  getAlbumPictures: function (query) {
    return get('/albums/pictures/', {}, query)
  },
  delAlbumPicture: function (id) {
    return del(`/albums/pictures/${id}/`)
  },
  createAlbumPicture: function (imgList, album) {
    // url, imgList, payload
    return uploadImage('/albums/pictures/', imgList, { 'album': album })
  },
  // 首页轮播最近六张图片
  getRecentPictures: function () {
    return get('/albums/pictures/recent/')
  },

}